export default {
	onShareAppMessage() {
		return {
			title: '快回收',
			path: this.getSharePath(),
			imageUrl: '图片',
		};
	},
	onShareTimeline() {
		return {
			title: '快回收',
			path: this.getSharePath(),
			imageUrl: '图片',
		};
	},
	methods: {
		getSharePath() {
			const pages = getCurrentPages();
			const currentPage = pages[pages.length - 1];
			const route = currentPage.route;
			const options = currentPage.options;
			let query = '';
			for (let key in options) {
				query += `${key}=${options[key]}&`;
			}
			return `/${route}?${query.slice(0, -1)}`;
		}
	}
};